package com.haust.commons.pojo;

import lombok.Data;

import java.io.Serializable;

@Data
public class HaustResult implements Serializable {
    private int status;
    private String msg;
    private Object data;

    public static HaustResult ok(){
        HaustResult br = new HaustResult();
        br.setMsg("OK");
        br.setStatus(200);
        return br;
    }

    public static HaustResult ok(Object data){
        HaustResult br = new HaustResult();
        br.setMsg("OK");
        br.setStatus(200);
        br.setData(data);
        return br;
    }


    public static HaustResult error(String msg){
        HaustResult br = new HaustResult();
        br.setMsg(msg);
        br.setStatus(400);
        return br;
    }
}
